package com.ccb.lms.service;

import java.sql.SQLException;
import java.util.List;

import com.ccb.lms.facade.FacadeDAO;
import com.ccb.lms.model.Authority;
import com.ccb.lms.util.BasePage;

public class AuthorityService implements IAuthorityService {
	private FacadeDAO facadeDAO = null;

	
	public FacadeDAO getFacadeDAO() {
		return facadeDAO;
	}

	public void setFacadeDAO(FacadeDAO facadeDAO) {
		this.facadeDAO = facadeDAO;
	}

	public boolean insertAuthority(Authority authority) throws SQLException {
		// TODO Auto-generated method stub
		return facadeDAO.getAuthorityDAO().insertAuthority(authority);
	}

	public boolean deleteAuthority(Integer authorityNO) throws SQLException {
		// TODO Auto-generated method stub
		return facadeDAO.getAuthorityDAO().deleteAuthority(authorityNO);
	}

	public boolean updateAuthority(Authority authority) throws SQLException {
		// TODO Auto-generated method stub
		return facadeDAO.getAuthorityDAO().updateAuthority(authority);
	}

	public List<Authority> getAllAuthorities() throws SQLException {
		// TODO Auto-generated method stub
		return facadeDAO.getAuthorityDAO().getAllAuthorities();
	}

	public Authority getAuthorityByNO(Integer authorityNO) throws SQLException {
		// TODO Auto-generated method stub
		return facadeDAO.getAuthorityDAO().getAuthorityByNO(authorityNO);
	}

	public int getAuthorityCount() throws SQLException {
		// TODO Auto-generated method stub
		return facadeDAO.getAuthorityDAO().getAuthorityCount();
	}

	public BasePage getBasePage(int currentPage, int showRecordNum)
			throws SQLException {
		// TODO Auto-generated method stub
		return facadeDAO.getAuthorityDAO().getBasePage(currentPage, showRecordNum);
	}

	public List<Authority> getAuthorityByPage(BasePage basePage) throws SQLException {
		// TODO Auto-generated method stub
		return facadeDAO.getAuthorityDAO().getAuthorityByPage(basePage);
	}
}
